import {createRouter, createWebHistory} from 'vue-router'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import('../views/login/Login.vue')
    },
    ,{
      path:'/consume',
      name:'consume',
      component: () => import('../views/consum/index.vue'),
    },
    ,{
      path:'/notice',
      name:'notice',
      component: () => import('../views/consum/notice.vue'),
    },
    ,{
      path:'/room-detail',
      name:'room-detail',
      component: () => import('../views/consum/room.vue'),
    },
    {
      path: '/profile',
      component: () => import('../views/profile/Profile.vue'),
      // 重定向
      redirect: '/room',
      // route level code-splitting
      children:[
        {
          path:'/room',
          name:'room',
          component: () => import('../views/room/index.vue'),
        },
        {
          path:'/notice-list',
          name:'notice-list',
          component: () => import('../views/notice/notice.vue'),
        },
        {
          path:'/alltheinfo',
          name:'alltheinfo',
          component: () => import('../views/info/AllTheInfo.vue'),
        },
        {
          path:'/banner',
          name:'banner',
          component: () => import('../views/banner/index.vue'),
        }
      ]
    }
  ]
})

export default router
